package com.acwing.partition37;

import java.io.*;

/**
 * 设矩形短边为a，长边为b，则有 2(a+b)=n，a<b
 * 当a=1时，b=n/2-1
 * 当a=2时，b=n/2-2
 * 当a=x时，b=n/2-x
 * x<n/2-x => x<n/4
 * @author rkc
 * @date 2022/8/9 9:15
 */
public class AC3667切木棍 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        while (true) {
            String s = reader.readLine();
            if (s == null || s.isEmpty()) break;
            int n = Integer.parseInt(s);
            if (n % 2 == 1) writer.write("0\n");
            else {
                if (n % 4 == 0) writer.write((n / 4 - 1) + "\n");
                else writer.write(n / 4 + "\n");
            }
        }
        writer.flush();
    }
}
